<?xml version="1.0" encoding="UTF-8" ?>

<html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:c="http://java.sun.com/jsp/jstl/core"
          xmlns:p="http://primefaces.org/ui"
      	  xmlns:ui="http://java.sun.com/jsf/facelets"
      	  xmlns:t="http://myfaces.apache.org/tomahawk">

	<h:body>
    	<ui:composition template="../../templates/general.xhtml">
      		<ui:define name="content">
      			
      			<f:metadata>
    				<f:viewParam id="aluno_id" name="id" value="#{alunoCrudBean.id}"/>
        			<f:viewParam id="mode" name="mode" value="#{alunoCrudBean.mode}"/>	
				</f:metadata>

				<f:event type="preRenderView" listener="#{alunoCrudBean.init}" />
      		
      			<h1 class="page-header"><i class="fa fa-user fa-3"></i> Aluno</h1>
      			
      			<p:growl id="messages" showDetail="true" autoUpdate="true"/>
      			
      			<h:panelGrid columns="4" >  
      					<p:panel styleClass="jumbotron" style="width:1024px;">
      					
      					<h:panelGrid columns="2" columnClasses="first" >
							<h:outputLabel for="ano" value="Ano Lectivo:" style="font-size: 0.9em;" />
							<p:inputText id="ano" value="#{alunoCrudBean.aluno.anoLectivo.descricao}" disabled="true" style="font-size: 0.9em;" />
						</h:panelGrid>
						
						<h:panelGrid columns="4" columnClasses="first,second" >
      						<h:outputLabel for="nome" value="Nome:" style="font-size: 0.9em;" />
            				<p:inputText id="nome" value="#{alunoCrudBean.aluno.nome}" style="width:400px; font-size: 0.9em;" disabled="#{alunoCrudBean.disableComponent}"/>
            		
            				<h:outputLabel for="numero" value="Número:" style="font-size: 0.9em;" />
            				<p:inputText id="numero" value="#{alunoCrudBean.aluno.numero}" required="true" disabled="#{alunoCrudBean.disableComponent}" style="font-size: 0.9em;" />

							<h:outputLabel for="mail" value="Email:" style="font-size: 0.9em;" />
            				<p:inputText id="mail" value="#{alunoCrudBean.aluno.email}" style="width:400px; font-size: 0.9em;" disabled="#{alunoCrudBean.disableComponent}" />

            				<h:outputLabel for="ddlGrupo" value="Grupo:" style="font-size: 0.9em;" />
            				<p:selectOneMenu id="ddlGrupo" value="#{alunoCrudBean.idGrupo}" disabled="#{alunoCrudBean.disableComponent}" style="font-size: 0.9em;" >
      							<f:selectItem itemLabel="Seleccione" itemValue=""/>
      							<f:selectItems value="#{alunoCrudBean.listaGrupos}" var="g" itemLabel="#{g.numero}" itemValue="#{g.id}"/>
  							</p:selectOneMenu>

            				<h:outputLabel for="userGit" value="User GitHub:" style="font-size: 0.9em;" />
            				<p:inputText id="userGit" value="#{alunoCrudBean.aluno.userGitHub}" disabled="#{alunoCrudBean.disableComponent}" style="font-size: 0.9em;" />
            			
            				<h:outputLabel for="userRed" value="User Redmine:" style="font-size: 0.9em;" />
            				<p:inputText id="userRed" value="#{alunoCrudBean.aluno.userRedmine}" disabled="#{alunoCrudBean.disableComponent}" style="font-size: 0.9em;" />
						</h:panelGrid>
            			</p:panel>
      			</h:panelGrid>
      			
      			<h3 class="page-header"></h3>
            			
            	<p:commandButton id="editar" value="Editar" action="#{alunoCrudBean.editar}" ajax="false" rendered="#{alunoCrudBean.renderBotaoEditar}" style="margin-right: 10px; margin-bottom: 50px; float:right; font-size: 0.9em;" />
            	<p:commandButton id="voltar" value="Voltar" action="#{alunoCrudBean.voltar}" ajax="false" rendered="#{alunoCrudBean.renderBotaoVoltar}" style="margin-right: 10px; margin-bottom: 50px; float:right; font-size: 0.9em;" />
            	<p:commandButton id="eliminar" value="Eliminar" action="#{alunoCrudBean.apagar}" ajax="false" rendered="#{alunoCrudBean.renderBotaoApagar}" style="margin-right: 10px; margin-bottom: 50px; float:right; font-size: 0.9em;" />
            	<p:commandButton id="gravar" value="Gravar" action="#{alunoCrudBean.gravar}" ajax="false" rendered="#{alunoCrudBean.renderBotaoGravar}" style="margin-right: 10px; margin-bottom: 50px; float:right; font-size: 0.9em;" />
      			
      		</ui:define>
		</ui:composition>
	</h:body>
</html>       	  